package me.jiatao.hilt.di

import android.util.Log
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import me.jiatao.hilt.OkHttpClient
import javax.inject.Singleton

class Repository(val okHttpClient: OkHttpClient) {
    fun getData() {
        Log.e("Repository", "------ Repository getData  ------")
        okHttpClient.post()
    }
}

@Module
@InstallIn(SingletonComponent::class)
class RepositoryModule {

    @Provides
    @Singleton
    fun provideRepository(okHttpClient: OkHttpClient): Repository {
        return Repository(okHttpClient)
    }
}